<html class="" style="font-size: 20px;">
 <head> 
  <title>牛省购APP注册页</title> 
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
  <meta name="MobileOptimized" content="320" /> 
  <meta name="viewport" content="initial-scale=1.0,user-scalable=no,minimum-scale=1.0, maximum-scale=1.0,width=device-width" /> 
  <meta name="apple-mobile-web-app-capable" content="yes" /> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
  <meta name="format-detection" content="telephone=no, email=no" /> 
  <link rel="apple-touch-icon" href="" data-role="site-logo" /> 
  <script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script>
  <script src="https://unpkg.com/vue-lazyload/vue-lazyload.js"></script>
  <meta http-equiv="x-dns-prefetch-control" content="on" /> 
  <link rel="dns-prefetch" href="//cdn.kuaizhan.com" /> 
  <link rel="dns-prefetch" href="//pfile.kuaizhan.com" /> 
  <link rel="dns-prefetch" href="//pic.kuaizhan.com" /> 
  <link rel="stylesheet" type="text/css" href="//cdn.kuaizhan.com/res/mobile/css/ui.css?v=5.0" /> 
  <meta http-equiv="Cache-Control" content="no-transform" />
  <link id="mobile-css" rel="stylesheet" type="text/css" href="//cdn.kuaizhan.com/res/skin/css/mobile.css?v=5.0" />
  <link href="https://cdn.bootcss.com/layer/2.1/skin/layer.css" rel="stylesheet">  
 </head> 
 <body style="font-size: 20px;"> 
   <div class="page-w ">
    <div id="page-content" class="page-content">
     <div class="mod mod-js"> 
      <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width,initial-scale=1" />
      <!--<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" media="screen" />-->
      <!--<link rel="stylesheet" type="text/css" href="https://api2159.dhcc.wang/assets/css/web_common.css" />-->
      <!--<link rel="stylesheet" type="text/css" href="https://api2159.dhcc.wang/assets/css/web_detail.css" />-->
      <!--<link rel="stylesheet" type="text/css" href="https://pfile.kuaizhan.com/files/portal_basic.css" />-->
      <link href="https://api2159.dhcc.wang/assets/web/static/css/app.610dd92dcf5c4396ea690d9774dfaaf5.css?version=1.0.1" rel="stylesheet" />
      <div class="page-w">
       <div id="app" class="page-content">
        <div class="mod mod-js">
         <div id="app">
          <div class="download-c">
           <div data-v-15006e3d="" id="details-body">
            <div data-v-15006e3d="" id="main">
             <div data-v-15006e3d="" class="banner">
                 <img data-v-15006e3d="" src="https://jinbanbook.oss-cn-shenzhen.aliyuncs.com/poster/5b92f3b60a761.jpg" />
             </div> 
             <div data-v-15006e3d="" class="dialog-box">
              <div data-v-15006e3d="" class="ipt-box">
               <div data-v-15006e3d="" class="ipt-row">
                <img data-v-15006e3d="" src="https://jinbanbook.oss-cn-shenzhen.aliyuncs.com/css-background/new-phone.png" alt="" /> 
                <div data-v-15006e3d="" class="input">
                 <input data-v-15006e3d="" v-model="mobile" type="text" placeholder="请输入手机号码" id="tel" />
                </div>
               </div>
              </div> 
              <div data-v-15006e3d="" class="ipt-box">
               <div data-v-15006e3d="" class="ipt-row msgcode">
                <img data-v-15006e3d="" src="https://jinbanbook.oss-cn-shenzhen.aliyuncs.com/css-background/new-msg.png" alt="" /> 
                <div data-v-15006e3d="" class="input">
                 <input data-v-15006e3d="" v-model="mobile_code" type="text" placeholder="请输入验证码" id="msgcode" />
                </div>
               </div> 
               <div data-v-15006e3d="" @click="getMoileCode()" id="m_zcyz" class="getcode">
                获取验证码
               </div>
              </div> 
              <div data-v-15006e3d="" class="ipt-box">
               <div data-v-15006e3d="" class="ipt-row">
                <img data-v-15006e3d="" src="https://jinbanbook.oss-cn-shenzhen.aliyuncs.com/css-background/new-pwd.png" alt="" /> 
                <div data-v-15006e3d="" class="input">
                 <input data-v-15006e3d="" v-model="password" type="password" placeholder="请设置登陆密码" id="pwd" />
                </div>
               </div>
              </div> 
              <div data-v-15006e3d="" @click="register()" class="reg">
                立即注册 
              </div>
             </div> 
             <div data-v-15006e3d="" class="reg-info">
              <div data-v-15006e3d="" class="info1">
               注册成功！
              </div> 
              <div data-v-15006e3d="" class="info2">
               下载牛省购查看吧
              </div> 
              <div @click="down()" data-v-15006e3d="" class="down">
               点击下载
              </div> 
              <div data-v-15006e3d="" class="uinfo">
               <div data-v-15006e3d="" id="regphone"></div> 
               <div data-v-15006e3d="">
                请下载后用手机号登录
               </div>
              </div>
             </div>
            </div>
           </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div> 
  </div> 
  <script src="https://cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
 <script>
	
	Vue.use(VueLazyload);

	var vue = new Vue({
		el: '#app',
		data: {
                    mobile:'',
                    password:'',
                    mobile_code:'',
                    id:'{$id}',
                    mobile_timeout:'',
                    mobile_count:100,
                    mobile_lock:0,
		},
		methods: {
                  register:function(){
                      var that = this;
                      console.log(that.mobile);
                      console.log(that.password);
                      console.log(that.mobile_code);
                      if(that.mobile==''){
                          layer.msg('手机不能为空');
                          return;
                      }
                      if(that.password==''){
                          layer.msg('密码不能为空');
                          return;
                      }
                      if(that.mobile_code==''){
                          layer.msg('验证码不能为空');
                          return;
                      }
                      var data = {
                          id:that.id,
                          mobile:that.mobile,
                          password:that.password,
                          mobile_code:that.mobile_code,
                      }
                      
                       $.get("/share.html",{data:data},function(resp){
                            console.log(resp);
                            if(resp.code===404){
                                layer.msg(resp.message);
                            }
                            if(resp.code===200){
                                layer.msg(resp.message);
                                $('.reg-info').addClass('active');
                                $('.reg-info').css('color','#969191');
                                $('.dialog-box').hide();
                            }
                        })
                
                },
                
                down:function(){
                    var url;
                    var u = navigator.userAgent, app = navigator.appVersion;
                    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
                    var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
                    if (isAndroid) {
                       //这个是安卓操作系统
                       url = "{$data['android']}";
                    }
                    if (isIOS) {
                        //这个是ios操作系统
                        url = "{$data['ios']}";
                    }
                    console.log('url',url);
                    window.href=url;
                },
                getMoileCode:function(){
                    var that = this;
                    if (that.mobile_lock == 0) {
                        $.get("/sms/mobile-code2",{mobile:that.mobile,token:that.token},function(resp){
                            console.log(resp);
                            if(resp.code===404){
                                layer.msg(resp.message);
                            }
                            if(resp.code===200){
                                layer.msg(resp.message);
                                that.mobile_lock = 1;
                                that.mobile_count = 60;
                                $(".m_zcyz").addClass("on");
                                $('#m_zcyz').attr("disabled", "disabled");
                                that.BtnCount();
                            }
                        })
                    }
                },
                BtnCount:function () {
                    var that = this;
                    if(that.mobile_count == 0) {
                        $(".m_zcyz").removeClass("on");
                        $('#m_zcyz').removeAttr("disabled");
                        $('#m_zcyz').html("重新发送");
                        that.mobile_lock = 0;
                        clearTimeout(that.mobile_timeout);
                    }
                    else {
                        that.mobile_count--;
                        $('#m_zcyz').html("获取(" + that.mobile_count.toString() + ")秒");
                        that.mobile_timeout = setTimeout(that.BtnCount, 1000);
                    }
                }
                },
		filters: {
                
		},
		mounted: function() {
			var _this = this;
			this.$nextTick( function () {
                           
			})
		},
	});
        </script>
 </body>
</html>